package com.forum.mapper;

import com.forum.model.vo.ActiveUserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@Mapper
public interface UserStatsMapper {
    
    @Select("SELECT u.id, u.username, u.picture, us.posts_count as postsCount, " +
            "us.comments_count as commentsCount, us.likes_count as likesCount " +
            "FROM user_stats us " +
            "JOIN user u ON us.user_id = u.id " +
            "ORDER BY (us.posts_count + us.comments_count * 0.5 + us.likes_count * 0.2) DESC " +
            "LIMIT 10")
    List<ActiveUserVO> findActiveUsers();
} 